//
//  ViewController.m
//  himalaya
//
//  Created by 楼楚 on 15/10/30.
//  Copyright © 2015年 Chu Lou. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UIScrollView *scrollView;
@property (weak, nonatomic) IBOutlet UIButton *lastButton;

@end

@implementation ViewController
/*setter方法
 contentSize 会根据边距调整offset
 contentInset  不会调整offset
 */
- (void)setScrollView:(UIScrollView *)scrollView
{
//先赋值
    _scrollView = scrollView;
    
    self.scrollView.contentInset = UIEdgeInsetsMake(64, 0, 49, 0);
    //  设置滚动视图内容
    CGFloat h = CGRectGetMaxY(self.lastButton.frame)+ 10;
    self.scrollView.contentSize=CGSizeMake(0, h);
//    设置间距
//     只是指定内容外侧边距，
    self.scrollView.contentInset = UIEdgeInsetsMake(64, 0, 0, 0);

//修改contentoffset
//    self.scrollView.contentOffset = CGPointMake(0, -64);
}
- (void)viewDidLoad {
    [super viewDidLoad];

}

@end
